# 第一阶段：编译阶段
FROM golang:1.21.13-bullseye AS builder
WORKDIR /app  
COPY app/email/ . 
COPY rpc_gen/ /rpc_gen  

ENV GOPROXY=https://goproxy.cn
RUN bash build.sh 


# 第二阶段：运行阶段
FROM debian:bullseye-slim AS runner
WORKDIR /app

COPY --from=builder /app/output ./output
COPY --from=builder /app/conf ./conf  

CMD ["bash", "output/bootstrap.sh"]